package org.example;

import org.apache.dubbo.config.annotation.Reference;
import org.example.service.api.HelloService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@RestController
public class App 
{
    @Reference(version = "1.1"/*mock = "org.example.mock.MockHelloService"*/,timeout = 3000,retries = 0)
    public HelloService helloService;

    @GetMapping("consumer")
    public String consumer (String name) {
        helloService.sayHello(name);
        return "consumer hello success!!!";
    }

    public static void main( String[] args )
    {
        SpringApplication.run(App.class, args);
    }
}
